package com.bigShen.pattern.factory.simple;

import com.bigShen.pattern.factory.BinJiang;
import com.bigShen.pattern.factory.House;
import com.bigShen.pattern.factory.LvDi;
import com.bigShen.pattern.factory.WanKe;

/**
 * Created by lei.shen on 2018/9/17.
 */
public class SimpleFactory {

    public House getHouse(String name) {

        if (name.equals("万科")) {
            return new WanKe();
        } else if (name.equals("滨江")) {
            return new BinJiang();
        } else if (name.equals("绿地")) {
            return  new LvDi();
        } else {
            System.out.println("暂不支持的品牌类型!");
            return null;
        }

    }

}
